<?php

namespace app\api\controller\v2_web;

use app\common\controller\Api;
use think\Db;

/**
 * 会员接口
 */
class Article extends Api
{

    protected $noNeedLogin = ['wxweb'];
    protected $noNeedRight = '*';

    private $config = [
        1 => '关于我们',
        2 => '用户协议',
        3 => '用户隐私',
        4 => '服务协议',
        5 => '注册协议',
        6 => '保密协议',
        7 => '众包助手',
        8 => '平台协议',
    ];

    /**小程序web页面*/
    public function wxweb() {
        $id = input('id/d', 0);
        $keys = array_keys($this->config);
        if (!in_array($id, $keys)) {
            $this->error('参数传递错误');
        }
        $article = Db::name('article');
        $article = $article->where(['id' => $id])->find();

        return view('v2_web/wxweb',['content'=>$article['content']]);
    }
}
